Labels

sports (42) football (35) fifa 2010 (20) soccer (20) world cup (19) fun (17) google (14) reviews (12) experiements (10) learnings (9) software (8) mac (7) cricket (5) video (5) friends (4) goal (4) linux (4) music (4) tennis (4) bangalore (3) brazil (3) keyboard (3) movie (3) mumbai attacks (3) tips (3) tricks (3) article (2) dharmendra (2) economictimes (2) health (2) heart attack (2) hindi (2) mavericks (2) osx (2) shortcuts (2) work (2) apsrtc (1) calendar (1) dad (1) india (1) maicon (1) responsibility (1) retrospection (1) virtualbox (1)

Saturday, June 12, 2004

Linux training ... part 2

This weekend is going to be all about house hunting. We need to find one by this month end. Hopefully we should find a good place to stay.

Yesterday was a very boring session of Linux training. It was all very theoretical and text book knowledge, most of which we already knew a lot and were hardly using. It was all about processes, process stack, threads, and IPC mechanisms.

We did have some nice fun in the afternoon session though. The instructor, who has spent most of his time working with the kernel and device drivers, demonstrated the abstraction of the file i/o calls [ open/read/write/close/ioctl ] using a live device. He called it a toy. It connected to the comp using a parallel port. The toy had 8 LEDs [ something like the 8 bits in a byte ] which glow in binary format when a decimal number is fed on the port. He had a kernel device driver written for this, that implemented the file i/o calls and initialised this module by giving the device a major and a minor number. After inserting this module into the kernel, he showed a user-level program which just did a simple "open" on this device and did a "write" onto it. The program prompts for the user to enter a decimal digit which is written onto the device. The LEDs were glowing, based on the decimal number entered. The binary equivalent of this number could be seen in the LEDs. This was cool to watch. Really looked like a very nice toy. Need to try it out sometime building it on my own.

One more thing which i got clarified in this session was the fact that "linux kernel code is non-preemptive" [ ofcourse, some parts of the 2.6 kernel a pre-emptive, but thats a different story ]. I had been confused about this, since I also read that linux was a multi-tasking OS. The funda is that the pre-emption happens *only* in the user space and *not* in the kernel space. So the scheduler only schedules the user level tasks. Once the process enters kernel space [ by calling a int 80 ], it now cannot be pre-empted, unless it makes itself "idle" [ or non-runnable ]. And interestingly, the scheduler [ apart from other 2 scenarios ]is invoked after a return from every system call.

Oops, its already tea time here now... need to go catch the broker for the houses ...

No comments:

Post a Comment